/**
 * Created by kule on 2017/7/7.
 */
import has from 'lodash/has';
import set from 'lodash/set';
import unset from 'lodash/unset';
import get from 'lodash/get';
export const changeKey=(obj,keyPath,newKeyPath,value)=>{
    if(!has(obj,keyPath)){
        return;
    }
    set(obj,newKeyPath,value||get(obj,keyPath));
    unset(obj,keyPath);
};

export default changeKey;